package com.example.administrator.kotlintabviewpagerfragment.fragment

import org.jetbrains.anko.button
import org.jetbrains.anko.verticalLayout

/**
 * Created by ZLG on 2017/6/25.
 */
class Tab2Fragment : android.support.v4.app.Fragment() {
    override fun onCreateView(inflater: android.view.LayoutInflater?, container: android.view.ViewGroup?, savedInstanceState: android.os.Bundle?): android.view.View {
        return xml()
    }

    /**
     * 动态创建布局
     * */
    fun xml(): android.view.View {
        var view = with(context) {
            verticalLayout {
                gravity = android.view.Gravity.CENTER_VERTICAL
                button("Tab2Fragment") {
                }
            }
        }
        return view
    }
}